/**
 * Copyright 2008 Adam Ruggles.
 * 
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package kiff.util.model;

import java.util.Collection;

/**
 * Tree Node interface.
 * @author Adam
 * @version $Id$
 * 
 * Created on Dec 4, 2008 at 6:43:09 PM 
 */
public interface TreeNode {
	/**
	 * Adds a node to the tree.
	 * @param node The node to add.
	 */
	void addChild(TreeNode node);
	/**
	 * Adds a node to the tree on the left side.
	 * @param node The node to add.
	 */
	void addLeftChild(TreeNode node);
	/**
	 * Adds a node to the tree on the right side.
	 * @param node The node to add.
	 */
	void addRightChild(TreeNode node);
	/**
	 * Returns an enumeration of the child nodes.
	 * @return An enumeration of the child nodes.
	 */
	Collection<TreeNode> getChildren();
	/**
	 * Returns the number of child nodes.
	 * @return The number of child nodes.
	 */
	int getNumberOfChildren();
	/**
	 * Returns the parent node or null if it's the root.
	 * @return The parent node.
	 */
	TreeNode getParent();
	/**
	 * Returns the text for the node.
	 * @return The text for the node
	 */
	String getText();
	/**
	 * Returns the type of this node.
	 * @return The type of this node.
	 */
	int getType();
	/**
	 * Returns true if the node is a leaf.
	 * @return True if the node is a leaf.
	 */
	boolean isLeaf();
	/**
	 * Removes all child nodes.
	 */
	void removeChildren();
	/**
	 * Sets the parent node.
	 * @param parent The parent node to set.
	 */
	void setParent(TreeNode parent);
	/**
	 * Sets the node text.
	 * @param text The text to set.
	 */
	void setText(String text);
	/**
	 * Sets the node type.
	 * @param type The type to set.
	 */
	void setType(int type);
}
